#include "nvic.h"

void NVIC_Initialization(uint32_t NVIC_PriorityGroup)
{
  NVIC_InitTypeDef NVIC_InitStructure={0};

  NVIC_PriorityGroupConfig(NVIC_PriorityGroup);

      /*****************************************************************
                            USART1 中断初始化
      *****************************************************************/
  NVIC_InitStructure.NVIC_IRQChannel=USART1_IRQn;
  NVIC_InitStructure.NVIC_IRQChannelCmd=ENABLE;
  NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority=0x03;
  NVIC_InitStructure.NVIC_IRQChannelSubPriority=0x01;
  NVIC_Init(&NVIC_InitStructure);
      /*****************************************************************
                            TIM3 中断初始化
      *****************************************************************/
  NVIC_InitStructure.NVIC_IRQChannel=TIM3_IRQn;
  NVIC_InitStructure.NVIC_IRQChannelCmd=ENABLE;
  NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority=0x03;
  NVIC_InitStructure.NVIC_IRQChannelSubPriority=0x01;
  NVIC_Init(&NVIC_InitStructure);
}